package com.onejson.ojmall.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.onejson.ojmall.common.domain.LoginLogVO;
import com.onejson.ojmall.model.entity.SLoginLogEntity;
import com.onejson.ojmall.model.form.SLoginLogQueryForm;
import com.onejson.ojmall.model.vo.SLoginLogVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * 用户登录日志 DAO 层
 *
 * @author wxx
 */
@Mapper
@Component
public interface SLoginLogDao extends BaseMapper<SLoginLogEntity> {


    /**
     * 分页查询
     *
     * @param page      分页配置
     * @param queryForm 查询参数
     * @return 返回列表
     */
    List<SLoginLogVO> query(Page<?> page, @Param("query") SLoginLogQueryForm queryForm);

    LoginLogVO queryLastByUserId(@Param("userId") Long userId,@Param("userType") Integer userType, @Param("loginLogResult")Integer loginLogResult);

}

